--- a/config/CMakeLists.txt
+++ b/config/CMakeLists.txt
@@ -40,6 +40,7 @@
     DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
   )
 
+  set(LIBRARY_OUTPUT_NAME gridxc)
   configure_file(
     "${CMAKE_CURRENT_SOURCE_DIR}/template.pkgconf"
     "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,11 @@
    message(STATUS "Setting BUILD_SHARED_LIBS to ${LIBGRIDXC_SHARED_LIBS}")
 endif()
 
+set(
+  module-dir
+  "${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}"
+)
+
 # General configuration information: Build_type, Config files...
 add_subdirectory("config")
 
@@ -135,11 +140,6 @@
 
 endif()
 
-set(
-  module-dir
-  "${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}"
-)
-
 target_include_directories(
   "${PROJECT_NAME}-lib"
   PUBLIC
